/*******************************************************************************
 * @project: CDMS_12
 * @package: com.esoon.cdms.model
 * @file: DesignModel.java
 * @author: Administrator
 * @created: 2017-6-23
 * @purpose:
 * 
 * @version: 1.0
 * 
 * Revision History at the end of file.
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/

package com.esoon.cdms.model;

import com.mentor.chs.api.IXDesign;
import com.mentor.chs.api.IXHarnessDesign;

public class DesignModel {
	private IXDesign design;
	private String id;
	private String name;
	private String partNumber;
	private String description;
	private String shortDescription;
	private String revision;
	
	public DesignModel() {
	}
	
	public DesignModel(IXDesign design) {
		this.setDesign(design);
		this.setId(design.getID());
		this.setName(design.getAttribute("Name"));
		if(design instanceof IXHarnessDesign){
			this.setPartNumber(design.getAttribute("partNumber"));
		}else{
			this.setPartNumber(design.getAttribute("ShortDescription"));
		}
		this.setDescription(design.getAttribute("Description"));
		this.setShortDescription(design.getAttribute("ShortDescription"));
		this.setRevision(design.getAttribute("Revision"));
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPartNumber() {
		return partNumber;
	}

	public void setPartNumber(String partNumber) {
		this.partNumber = partNumber;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	public String getRevision() {
		return revision;
	}

	public void setRevision(String revision) {
		this.revision = revision;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public IXDesign getDesign() {
		return design;
	}

	public void setDesign(IXDesign design) {
		this.design = design;
	}
	
}


/*******************************************************************************
 * <B>Revision History</B><BR>
 * [type 'revision' and press Alt + / to insert revision block]<BR>
 * 
 * 
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/